<div *ngIf="error" class="alert alert-danger">{{ error }}</div>

<form role="form" (ngSubmit)="changePassword()" [formGroup]="form">

  <label i18n for="current-password">Change password</label>
  <input
    type="password" id="current-password" i18n-placeholder placeholder="Current password" autocomplete="current-password"
    formControlName="current-password" [ngClass]="{ 'input-error': formErrors['current-password'] }" class="form-control"
  >
  <div *ngIf="formErrors['current-password']" class="form-error">
    {{ formErrors['current-password'] }}
  </div>

  <input
    type="password" id="new-password" i18n-placeholder placeholder="New password" autocomplete="new-password"
    formControlName="new-password" [ngClass]="{ 'input-error': formErrors['new-password'] }" class="form-control"
  >
  <div *ngIf="formErrors['new-password']" class="form-error">
    {{ formErrors['new-password'] }}
  </div>

  <input
    type="password" id="new-confirmed-password" i18n-placeholder placeholder="Confirm new password" autocomplete="new-password"
    formControlName="new-confirmed-password" class="form-control"
  >
  <div *ngIf="formErrors['new-confirmed-password']" class="form-error">
    {{ formErrors['new-confirmed-password'] }}
  </div>

  <input type="submit" i18n-value value="Change password" [disabled]="!form.valid">
</form>
